#include <stdio.h>
int main(){
    int num=0;
    int place=0;
    printf("num=\n");
    scanf("%d",&num);
    if(num>9999){
        place=5;
        printf("%d\n",place);
    }else if(num>999){
        place=4;
        printf("%d\n",place);
    }else if(num>99){
        place=3;
        printf("%d\n",place);
    }else if(num>9){
        place=2;
        printf("%d\n",place);
    }else{
        place=1;
        printf("%d\n",place);
    }
    int a=num/10000;
    int b=num%10000/1000;
    int c=num%10000%1000/100;
    int d=num%10000%1000%100/10;
    int e=num%10;
    printf("%d\n",a);
    printf("%d\n",b);
    printf("%d\n",c);
    printf("%d\n",d);
    printf("%d\n",e);
    printf("%d%d%d%d%d",e,d,c,b,a);
    return 0;
}